Skip to content

Add Erdős Problem 1167 (stepping-down partition relation)#3791

Open
henrykmichalewski wants to merge 3 commits into
google-deepmind:mainfrom
henrykmichalewski:add-problem-1167
Open

Add Erdős Problem 1167 (stepping-down partition relation)#3791
henrykmichalewski wants to merge 3 commits into
google-deepmind:mainfrom
henrykmichalewski:add-problem-1167

Conversation

@henrykmichalewski
Copy link
Copy Markdown
Member

Formalizes Erdős Problem 1167 concerning a stepping-down partition relation for cardinals.

Contents

  • New definition CardinalPartitionRel μ r γ ν: an r-uniform generalization of the cardinal partition relation μ → (ν)^r_γ, asserting that for every coloring of r-element subsets of μ with γ colors there is a monochromatic subset of size ν.
  • The main open theorem statement for Problem 1167.
  • Four variants exploring boundary cases:
    • finite_targets: behavior with finite target cardinalities
    • binary_colors: the two-color specialization
    • infinite_targets: behavior for infinite targets
    • r_eq_two: the r = 2 (graph) specialization

Closes #1991

Assisted by Claude (Anthropic).

@github-actions github-actions Bot added the erdos-problems Erdős Problems label Apr 17, 2026
Mirrors the Round C docstring pass from the private repo's
phase1-infrastructure branch. Each Lean file now carries the
canonical source statement and upstream URL inline so reviewers
can verify formalization against the source without navigating
away from the diff.
@Paul-Lez Paul-Lez added the awaiting-author The author should answer a question or perform changes. Reply when done. label May 7, 2026
@mo271 mo271 removed the awaiting-author The author should answer a question or perform changes. Reply when done. label May 13, 2026
Copy link
Copy Markdown
Collaborator

@mo271 mo271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice formalization — CardinalPartitionRel is a clean definition that captures the partition arrow well, and the translation is faithful. A few issues:

  1. Excessive docstring duplication

The problem statement appears ~4 times: the verbatim quote (line 23), the "Problem Statement" section (lines 34–38), the overview paraphrase (lines 57–59), and the erdos_1167 theorem docstring (lines 105–118). Per project conventions, the problem text should appear only once. Please keep the verbatim quote in the module docstring and trim the rest — the theorem docstring should describe anything not already in the module docstring rather than restating it.

  1. Non-standard module docstring format

The module docstring uses non-standard headers: Verbatim statement (Erdős #1167, status O):, Source:, Notes: OPEN. Please use the standard format with just Reference: and the verbatim quote.

  1. CardinalPartitionRel should be in ForMathlib

This is a clean, general definition of the partition arrow $\mu \to (\nu_\alpha)_{\alpha<\gamma}^r$. It's a fundamental concept in infinitary combinatorics and would be reusable by other Erdős problems involving Ramsey-type statements. Please move it to FormalConjecturesForMathlib/ (e.g., Combinatorics/SetTheory/PartitionRelation.lean).

  1. binary_colors variant doesn't use CardinalPartitionRel

All other variants reuse CardinalPartitionRel, but binary_colors inlines the definition manually with Fin 2 and a disjunction (∨). This creates code duplication and inconsistency. Please rewrite it using CardinalPartitionRel with γ = 2.

  1. Missing answer(sorry)

The source asks "Is it true that...?" — a yes/no question. Per project conventions this should use answer(sorry) ↔ ∀ (r : ℕ), 2 ≤ r → .... The current formulation asserts the statement directly, which presupposes the answer is "yes."

  1. Sanity checks don't test CardinalPartitionRel

The current tests (ℵ₀ ≤ ℵ₀, ℵ₀ < 2^ℵ₀, s.card = 0 → s = ∅) are trivial facts that don't exercise the central definition at all. Consider adding tests that actually involve CardinalPartitionRel, e.g. the trivial/vacuous cases or a known finite Ramsey instance.

Comment on lines +226 to +247
/--
**Sanity check**: The hypothesis `ℵ₀ ≤ lam` is non-vacuous: $\aleph_0$ is an infinite cardinal.
-/
@[category test, AMS 5]
example : ℵ₀ ≤ ℵ₀ := le_refl _

/--
**Sanity check**: $2^{\aleph_0} > \aleph_0$, so the power $2^\lambda$ is strictly larger than
$\lambda$ for $\lambda = \aleph_0$. This confirms the two base sets in the stepping-down
implication are genuinely of different sizes.
-/
@[category test, AMS 5]
example : ℵ₀ < (2 : Cardinal) ^ ℵ₀ := Cardinal.cantor ℵ₀

/--
**Sanity check**: Every 0-element finset is empty. This confirms `Finset.card = 0` is
non-trivial and that the condition `s.card = r` in `CardinalPartitionRel` correctly captures
the notion of an $r$-element subset.
-/
@[category test, AMS 5]
example (A : Type u) (s : Finset A) (hs : s.card = 0) : s = ∅ :=
Finset.card_eq_zero.mp hs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none of these are really useful: they are just some theorems in mathlib that don't need repeating here -- those definitions are sufficiently tested in mathlib

Per mo271 review on PR google-deepmind#3791 — 6 issues + 1 inline:

1. Statement deduplication — kept only the verbatim quote in the erdos_1167
   theorem docstring; removed the ## Problem Statement / ## Overview /
   theorem-body restatement bloat.
2. Module docstring standardised — now just *Reference:* + brief formalisation
   notes; dropped the **Verbatim statement** / **Source** / **Notes: OPEN**
   non-standard headers.
3. CardinalPartitionRel factored into FormalConjecturesForMathlib —
   new module FormalConjecturesForMathlib/Combinatorics/SetTheory/PartitionRelation.lean
   defines Combinatorics.cardinalPartitionRel with the same signature; added
   to the umbrella import. The local Erdos1167.CardinalPartitionRel is gone.
4. binary_colors variant rewritten to use cardinalPartitionRel with γ = 2
   (instantiating the type-uniformly via ((2 : Ordinal.{u}).ToType → Cardinal)).
   Was previously inlined as a Fin 2-valued disjunction.
5. erdos_1167 now uses the answer(sorry) ↔ ... pattern (was previously
   asserting the implication directly, presupposing the answer is yes).
6. Trivial sanity checks dropped — the three tests (ℵ₀ ≤ ℵ₀, ℵ₀ < 2^ℵ₀,
   s.card = 0 → s = ∅) were Mathlib facts that didn't exercise the central
   definition, per mo271's inline at line 247.

Builds cleanly:
    lake build FormalConjectures.ErdosProblems.«1167»

Net diff on 1167.lean: -134 / +30 (substantially shorter, focused).
@henrykmichalewski
Copy link
Copy Markdown
Member Author

@mo271 — applied all 6 issues + your inline comment in ccb04a5:

  1. Statement deduplication — kept only the verbatim quote in the erdos_1167 theorem docstring; dropped ## Problem Statement, ## Overview, and the in-theorem restatement.
  2. Standardised module docstring — now just *Reference:* + brief formalisation notes; dropped the Verbatim statement (Erdős #1167, status O) / Source / Notes: OPEN non-standard headers.
  3. CardinalPartitionRelCombinatorics.cardinalPartitionRel factored into the new module FormalConjecturesForMathlib/Combinatorics/SetTheory/PartitionRelation.lean and added to the umbrella import.
  4. binary_colors rewritten to use cardinalPartitionRel with γ = 2; signature is now (κ : (2 : Ordinal.{u}).ToType → Cardinal.{u}) matching the general shape, no more inlined Fin 2 → ... ∨ ... disjunction.
  5. erdos_1167 now uses answer(sorry) ↔ ... rather than asserting the implication directly.
  6. Trivial sanity checks dropped (per your inline) — the three Mathlib-fact tests didn't exercise cardinalPartitionRel. The remaining file is sharper.

Net diff on 1167.lean: -134 / +30. Build green.

@mo271
Copy link
Copy Markdown
Collaborator

mo271 commented May 14, 2026

Thanks! Some more review comments:

  1. Remove formalization notes from module docstring

The module docstring (lines 24–35) contains a "Formalization notes" section explaining implementation choices (Ordinal.ToType, avoiding λ, cardinal successor). The module docstring should contain only the title and reference — not formalization notes. The last bullet about $\kappa + 1 = \kappa$ for infinite cardinals also duplicates the source's own clarification already present in the theorem docstring. Please remove the "Formalization notes" section entirely. If any of these notes are truly needed, they belong as code comments near the relevant definitions.

  1. ForMathlib: consider adding basic API (optional)

The PartitionRelation.lean file is clean (no sorry, correct conventions), but it only contains the bare definition. Even one or two sorry-free lemmas would improve reusability — e.g., the trivial 0-uniform case, or monotonicity in the source cardinal.

  1. No tests (optional)

Consider adding @[category test] sanity checks that exercise cardinalPartitionRel — the old trivial tests (ℵ₀ ≤ ℵ₀, s.card = 0 → s = ∅) were correctly removed but not replaced.

  1. make sure to resolve the conflicts with HEAD in FormalConjecturesForMathlib.lean

@mo271 mo271 added the awaiting-author The author should answer a question or perform changes. Reply when done. label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author The author should answer a question or perform changes. Reply when done. erdos-problems Erdős Problems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Erdős Problem 1167: Partition Arrow Cardinal Implication

3 participants